<template>
  <button @click="isShowDemo = !isShowDemo">切换隐藏/显示</button>
  <!--如果v-if的值为false，会将组件卸载（vue2中叫做销毁）-->
  <Demo v-if="isShowDemo"/>
</template>

<script>
import Demo from './components/Demo.vue'
import { ref } from 'vue'
export default {
  name: 'App',
  components:{
    Demo
  },
  setup() {
    let isShowDemo = ref(true)

    return {
      isShowDemo,
    }
  }
}
</script>

<style>
</style>
